package com.c2c.controller.user;


import com.c2c.po.Orders;
import com.c2c.service.AccountService;
import com.c2c.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/userSell")
public class UserSellController {
    @Autowired
    private OrderService orderService;

    //卖家订单
    @RequestMapping("sellOrder")
    public String sellOrder(@PathVariable int userAccount, HttpServletRequest request){
        List<Orders> ordersList=orderService.findAllOrderByGoodsId(userAccount);
        request.setAttribute("ordersList",ordersList);
        return "userSell";
    }

    //发货状态
    @RequestMapping("condition")
    public String sellCondition(Orders orders,int ordersState,HttpServletRequest request){
        orderService.updateOrderStateByOrderId(orders,ordersState);
        return "userSell";
    }

}
